<include file="Public:header"/>


        <!--body wrapper start-->
        <div class="wrapper">
             <div class="row">
                <div class="col-sm-12">
                <section class="panel">
                <header class="panel-heading">
                    图片列表
                    <!--<span class="tools pull-right">
                        <a href="javascript:;" class="fa fa-chevron-down"></a>
                        <a href="javascript:;" class="fa fa-times"></a>
					</span>-->
                </header>
                <div class="panel-body">
                <div class="adv-table editable-table ">
                <div class="clearfix">
                    <div class="btn-group">
						<a href="#addmyModal" data-toggle="modal" >
							<button class="btn btn-primary ">
								添加 <i class="fa fa-plus"></i>
							</button>
                        </a>
						<a href="{:U('Tupian/tupian_changetime')}" target="_blank" >
							变时间
                        </a>

                    </div>
                    <!--<div class="btn-group pull-right">
                        <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">Tools <i class="fa fa-angle-down"></i>
                        </button>
                        <ul class="dropdown-menu pull-right">
                            <li><a href="#">Export to Excel</a></li>
                        </ul>
                    </div>-->
                </div>
                <div class="space15"></div>
                <table class="table table-striped table-hover table-bordered" id="editable-sample">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>ID</th>
                    <th>中文名称</th>
                    <th>头像</th>
                    <th>所属分类</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
					<volist name="list" id="l" key="i">
						<tr class="">
							<td>{$i}</td>
							<td>{$l.teamId}</td>
							<td>{$l.name}</td>
							<td><img src="{$l.avatar}" height="40" /></td>
							<td>{$l.gname}</td>
							<td>
								<a class="tan_edit" data-toggle="modal" href="#bianjibox{$l.teamId}">编辑</a>
								|
								<php>
								if($l['state']==1){
								</php>
									<a href="javascript:;" onclick="del_admin({$l.teamId},'teams',this,'teamId')">删除</a>
								<php>
								}else{
								</php>
									<a href="javascript:;" onclick="hui_admin({$l.teamId},'teams',this,'teamId')">恢复</a>
									|
									<a href="javascript:;" class="cddel_admin_btn" onclick="cddel_admin({$l.teamId},'teams',this,'teamId')">彻底删除</a>
								<php>
								}
								</php>
							</td>
							<!--编辑框 start-->
							<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="bianjibox{$l.teamId}" class="modal fade">
								<div class="modal-dialog">
									<div class="modal-content">
										<div class="modal-header">
											<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
											<h4 class="modal-title">编辑</h4>
										</div>
			
										<div class="modal-body ">
											<form enctype="multipart/form-data" action="{:U('Tupian/tupian_edit')}" method="post">
												<input type="hidden" name="id" value="{$l.teamId}">
												<div class="form-group">
													<label>名称：</label>
													<input id="name" name="name" value="{$l.name}" class="form-control">
												</div>
												<div class="form-group">
													<label for="exampleInputFile">头像：</label>
													<p>
														<img src="{$l.avatar}" width="40" />
													</p>
													<input type="file" id="imgurl" name="img">
													<p class="help-block">大小不超过500KB</p>
												</div>
												<div class="form-group">
													<label>所属分类</label>
													<select name="gid" class="form-control">
														<volist name="fenleis" id="g" key="ii">
															<option value="{$g.game_typeId}"  <php>if($g['game_typeId']==$l['gid']){</php>selected="selected"<php>}</php>>{$g.cnName}</option>
														</volist>
													</select>
												</div>
												<button type="submit" class="btn btn-primary">保存</button>
											</form>
										</div>
			
									</div>
								</div>
							</div>
							<!--编辑框 end-->
						</tr>
					</volist>

                </tbody>
                </table>
                </div>
                </div>
                </section>
                </div>
                </div>
        </div>
        <!--body wrapper end-->
		<!--添加框 start-->
		<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="addmyModal" class="modal fade">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
						<h4 class="modal-title">添加</h4>
					</div>
					<div class="modal-body">

						<form enctype="multipart/form-data" role="form" action="{:U('Tupian/tupian_edit')}" method="post" >
							<input type="hidden" name="id" value="">
							<div class="form-group">
								<label>名称：</label>
								<input id="name" name="name" value="" class="form-control">
							</div>
							<div class="form-group">
                                <label for="exampleInputFile">头像：</label>
                                <input type="file" name="img">
                                <p class="help-block">大小不超过500KB</p>
                            </div>
							<div class="form-group">
								<label>所属分类</label>
								<select name="gid" class="form-control">
									<volist name="fenleis" id="g">
										<option value="{$g.game_typeId}"  <php>if($g['game_typeId']==$l['gid']){</php>selected="selected"<php>}</php>>{$g.cnName}</option>
									</volist>
								</select>
							</div>
							<button type="submit" class="btn btn-primary">保存</button>
						</form>
					</div>
				</div>
			</div>
		</div>
		<!--添加框 end-->

    </div>
    <!-- main content end-->
	
<include file="Public:footer"/>

